package interview1719;

/**
 *
 * @author CaoYu
 * @date 2021年9月26日
 * @description
 */
public class View1 extends View1719 {

	@Override
	public int[] missingTwo(int[] nums) {
		int N = nums.length + 2;
		int total = N * (N + 1) >> 1;
		for (int num : nums)
			total -= num;
		int M = total >> 1;
		int subTotal = M * (M + 1) >> 1;
		for (int num : nums)
			if (num <= M)
				subTotal -= num;
		return new int[] { subTotal, total - subTotal };
	}

	public static void main(String[] args) {
		View1 v = new View1();
		v.debug1();
		v.debug2();
		v.debug3();
		v.debug4();
//		int sum = 0;
//		int start = 1;
//		int end = 8;
//		int jump1 = 2;
//		int jump2 = 7;
//		int xor = 0;
//		for (int i = start; i <= end; i++) {
//			if (i != jump1 && i != jump2) {
//				sum += i;
//				xor ^= i;
//			}
//		}
//		int exor = 0;
//		for (int i = start; i <= end; i++) {
//			exor ^= i;
//		}
//
//		int esum = (start + end) * (end - start + 1) / 2;
//		System.out.println(esum + " " + sum + " " + (esum - sum));
//		System.out.println(exor + " " + xor + " ");
//		System.out.println(jump1 + jump2);
//		System.out.println(jump1 ^ jump2 ^ 1);

	}

}
